$(function(){
	//加载更多
	$(".loadAll").click(function(){
		imgShowIndex.loadAll();
	});
	
});
var imgShowIndex={
	/**
	 * 滚动加载
	 */
	scrollLoad:function(){
		var page=$("#imgPage").val();
		page=Number(page)+1;
		$("#imgPage").val(page);
		imgShowIndex.getImgInfo(page);
	},
	getImgInfo:function(page){
		$.ajax({
			type:"GET",
			url:$("#pathId").val()+"/img/imgShow_?page="+page,
			dataType:"json",
			success:function(data){
				var html="";
				$.each(data,function(i,n){
					html=html+"<div class='col-md-3 team-grids'><div class='thumbnail team-thmnl'>" +
					"<img src='"+n+"' class='img-responsive zoom-img' alt='···'><div class='caption'></div></div></div>";
				});
				$("#imgShowDiv").append(html);
			}
		})
	},
	/**
	 *加载更多
	 */
	loadAll:function(){
		var page=$("#imgPage").val();
		page=Number(page)+1;
		$("#imgPage").val(page);
		$.ajax({
			type:"GET",
			url:$("#pathId").val()+"/img/imgShow4SW_?page="+page,
			dataType:"json",
			success:function(data){
				var html="";
				$.each(data,function(i,n){
					html=html+"<li><div class='am-gallery-item'> <a href='"+n+"' class=''>" +
					"<img src='"+n+"'  alt='远方 有一个地方 那里种有我们的梦想'/>" +
					"<h3 class='am-gallery-title'></h3><div class='am-gallery-desc'>" +
					"</div></a></div></li>";
				});
				$("#loadImg").append(html);
			}
		})
	}
}

//获取滚动条当前的位置 
function getScrollTop() { 
var scrollTop = 0; 
if (document.documentElement && document.documentElement.scrollTop) { 
scrollTop = document.documentElement.scrollTop; 
} 
else if (document.body) { 
scrollTop = document.body.scrollTop; 
} 
return scrollTop; 
} 

//获取当前可是范围的高度 
function getClientHeight() { 
var clientHeight = 0; 
if (document.body.clientHeight && document.documentElement.clientHeight) { 
clientHeight = Math.min(document.body.clientHeight, document.documentElement.clientHeight); 
} 
else { 
clientHeight = Math.max(document.body.clientHeight, document.documentElement.clientHeight); 
} 
return clientHeight; 
} 

//获取文档完整的高度 
function getScrollHeight() { 
return Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); 
} 